<html xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <title></title>

    <script src="/forum/public/static/js/jquery1.8.3/jquery.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var load_user="{$Request.session.user}";
            if (load_user!==""){
                $("#load_message").html(load_user+"|<a href='/forum/index.php/user/logout'>注销</a>");
            }
        });

        //获取url中的参数
        function getUrlParam(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
            var r = window.location.search.substr(1).match(reg);  //匹配目标参数
            if (r != null)
                return unescape(r[2]);
            return null; //返回参数值
        }

        function ft() {
            var m_id = getUrlParam('mid');
            var load_user="{$Request.session.user}";
            if(load_user==""){
                alert("请先登录！")
            }else {
                window.location.href = '/forum/index.php/thread/post.html?mid=' + m_id;
            }
        }

        function insert() {
            window.location.href = '/forum/index.php/thread/insert'
        }

        function search(page) {
            var kw=$("#kw").val();
            window.location.href='/forum/index.php/thread/search/search?kw='+kw
        }
    </script>
    <link rel="stylesheet" href="/forum/public/static/css/forum/forum.css">
    <link rel="stylesheet" href="/forum/public/static/css/forum/public.css">
    <link rel="stylesheet" href="/forum/public/static/css/forum/thread.css">

</head>
<body>
<div class="top-bar">
    <div class="main">
        <div class="t_u" id="load_message">
            <a href="/forum/index.php/user/register.html">注册</a>
            |
            <a href="/forum/index.php/user/login.html" id="login">登录</a>
        </div>
    </div>
</div>
<div class="forum_path">
    {$thread_head}
</div>
<div class="forum_path">
    <input type="text" id="kw" style="width: 40%;">
    <input type="image" src="/forum/public/static/pic/search.jpg" onclick="search()">
</div>
<div class="forum_style">
    <li>
        <span style="width: 550px">主题</span>
        <span style="width: 150px">作者</span>
        <span style="width: 80px">回复</span>
        <span style="width: 150px">最后发表</span>
    </li>
</div>
<div class="forum_main">
    <ul class="flist">
        {volist name="thread_context" id="vo"}
        <li>
            <div class="ftitle">
                <a href="/forum/index.php/thread/read.html?mid={$mid}&id={$vo.id}">{$vo.title}</a>
            </div>
            <div class="fuser">
                {$vo.name} <br>{$vo.first_time}
            </div>
            <div class="fre">
                208<br>7611
            </div>
            <div class="flast">
                最后回复
                <br>
                {$vo.last_time}
            </div>
        </li>
        {/volist}
    </ul>
</div>
<div class="forum_top">
    <input id="reply" type="image" src="/forum/public/static/pic/post.png" onclick="ft()">
    <ul class="page_num" id="page_banner">
        {$page_banner}
    </ul>
</div>
</body>
</html>

